Don't assume that priv->current_page is non-NULL. (#347048, Guillaume
authorMatthias Clasen <mclasen@redhat.com>
Mon, 10 Jul 2006 16:19:24 +0000 (16:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 10 Jul 2006 16:19:24 +0000 (16:19 +0000)
2006-07-10  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
that priv->current_page is non-NULL.  (#347048, Guillaume
Cottenceau)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkassistant.c

index 896a27b8068d17c4c288069c1d7afa7cbe95b604..c8c7baa7a2bdf19a060fd798100600a978299a19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-07-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
+       that priv->current_page is non-NULL.  (#347048, Guillaume 
+       Cottenceau)
+
        * gtk/gtk.symbols: Add some missing deprecation guards.
 
        * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc.
index 896a27b8068d17c4c288069c1d7afa7cbe95b604..c8c7baa7a2bdf19a060fd798100600a978299a19 100644 (file)
@@ -1,5 +1,9 @@
 2006-07-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
+       that priv->current_page is non-NULL.  (#347048, Guillaume 
+       Cottenceau)
+
        * gtk/gtk.symbols: Add some missing deprecation guards.
 
        * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc.
index bdbcc6e5772c2832c9671749a1fd6f23b2e6e0cb..d32fdbf5c5431de5ba0071c8f59057797d83ffe9 100644 (file)
@@ -1325,7 +1325,8 @@ gtk_assistant_focus (GtkWidget        *widget,
   if (container->focus_child == priv->action_area)
     {
       if (!gtk_widget_child_focus (priv->action_area, direction) &&
-         !gtk_widget_child_focus (priv->current_page->page, direction))
+         (priv->current_page == NULL ||
+          !gtk_widget_child_focus (priv->current_page->page, direction)))
        {
          /* if we're leaving the action area and the current page hasn't
             any focusable widget, clear focus and go back to the action area */
@@ -1335,13 +1336,15 @@ gtk_assistant_focus (GtkWidget        *widget,
     }
   else
     {
-      if (!gtk_widget_child_focus (priv->current_page->page, direction) &&
+      if ((priv->current_page ==  NULL ||
+          !gtk_widget_child_focus (priv->current_page->page, direction)) &&
          !gtk_widget_child_focus (priv->action_area, direction))
        {
          /* if we're leaving the current page and there isn't nothing focusable
             in the action area, try to clear focus and go back to the page */
          gtk_window_set_focus (GTK_WINDOW (widget), NULL);
-         gtk_widget_child_focus (priv->current_page->page, direction);
+         if (priv->current_page != NULL)
+           gtk_widget_child_focus (priv->current_page->page, direction);
        }
     }